#include <iostream>

using namespace std;
int cnt[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};

int calc(int x)
{
    if(x == 0) return 6;
    int sum = 0;
    while(x)
    {
        sum += cnt[x % 10];
        x /= 10;
    }
    return sum;
}
int main()
{
    int n; cin >> n;
    int ret = 0;
    for(int a = 0;a < 1000;a ++)
    {
        for(int b = 0;b < 1000;b ++)
        {
            int c = a + b;
            if(calc(a) + calc(b) + calc(c) + 4 == n)
            {
                ret ++;
            }
        }
    }
    cout << ret << endl;
    return 0;
}